package com.dingdang.service.user;

import com.dingdang.mapper.UserMapper;
import com.dingdang.model.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements  UserService{

    @Resource
    private UserMapper userMapper;

    @Override
    public int addUser(User user) { return userMapper.addUser(user);}

    @Override
    public int deleteUser(User user){
        return userMapper.deleteUser(user);
    }

    @Override
    public  int updateUser(User user){
        return userMapper.updateUser(user);
    }

    @Override
    public  User getUserById(User user){
        return userMapper.getUserById(user);
    }

    @Override
    public int getUserByUserNameAndPassWord(User user) {return  userMapper.getUserByUserNameAndPassWord(user);}

    @Override
    public List<User> findAllUser() {
        return userMapper.selectAllUser();
    }
}
